<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="bookMeetingRoom.title"/></title>
    <meta name="heading" content="<fmt:message key='bookMeetingRoom.heading'/>"/>
    <meta name="menu" content="UserMenu"/>
    <script type="text/javascript" src="<c:url value='/scripts/selectbox.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar-setup.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/lang/calendar-en.js'/>"></script>
</head>

<s:form name="bookMeetingRoomForm" action="bookMeetingRoom" method="post" validate="true">
    <li style="display: none">
        <s:hidden key="bookMeetingRoom.id"/>
        <s:hidden key="bookMeetingRoom.meetingRoom.id"/>
        <s:hidden key="bookMeetingRoom.user.id"/>
        <s:hidden key="bookMeetingRoom.version"/>
        <input type="hidden" name="from" value="${param.from}"/>
    </li>
    
    <li class="buttonBar">
        <s:submit key="button.save" method="save" onclick="onFormSubmit(this.form)"/>
    <c:if test="${param.from == 'list' and not empty bookMeetingRoom.id}">
        <s:submit key="button.delete" method="delete" onclick="return confirmDelete('user')"/>
    </c:if>
    
        <s:submit key="button.cancel" method="cancel"/>
    </li>
    
    <s:textfield key="bookMeetingRoom.startTime" cssClass="text large" required="true"/>
    <s:textfield key="bookMeetingRoom.endTime" cssClass="text large" required="true"/>
    <s:textarea key="bookMeetingRoom.description" cssClass="text large" required="true"/>
    
    <li class="buttonBar bottom">
        <s:submit key="button.save" method="save" onclick="onFormSubmit(this.form)"/>

    <c:if test="${param.from == 'list' and not empty bookMeetingRoom.id}">
        <s:submit key="button.delete" method="delete" onclick="return confirmDelete('book meeting room')"/>
    </c:if>

        <s:submit key="button.cancel" method="cancel"/>
    </li>
</s:form>

<script type="text/javascript">
Calendar.setup({
    inputField     :    "bookMeetingRoom_bookMeetingRoom_startTime",   // id of the input field
    ifFormat       :    "%m/%d/%Y %H:%M",       // format of the input field
    showsTime      :    true,
    timeFormat     :    "24",
    singleClick    :    true
});
	
Calendar.setup({
    inputField     :    "bookMeetingRoom_bookMeetingRoom_endTime",   // id of the input field
    ifFormat       :    "%m/%d/%Y %H:%M",       // format of the input field
    showsTime      :    true,
    timeFormat     :    "24",
    singleClick    :    true
});
</script>
